//
//  RequestOperationManager.m
//  CFFinanceProject
//
//  Created by chunfeng on 2018/4/9.
//  Copyright © 2018年 xiaowen. All rights reserved.
//

#import "RequestOperationManager.h"

#import <CommonCrypto/CommonDigest.h>
#import <CommonCrypto/CommonCryptor.h>
#import "GTMBase64.h"


@implementation RequestOperationManager

+ (void)getVersionSuccess:(void (^)(id result))successBlock
                 failture:(void (^)(NSError *error))failtureBlock{
    NSString * urlStr = DEF_URL_VERSION;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * type = @"2";
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign,type);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}


+(void)startUp_Success:(void (^)(id result))successBlock
              failture:(void (^)(NSError *error))failtureBlock{
    NSString * urlStr = DEF_URL_STARTUP;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)sendCode_action:(NSString *)action
                        phone:(NSString *)phone
                      Success:(void (^)(id result))successBlock
                     failture:(void (^)(NSError *error))failtureBlock{
    NSString * urlStr = DEF_URL_SENDCODE;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = OKDicBind(action,phone,randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)login_phon:(NSString *)iphone
         password:(NSString *)password
          Success:(void (^)(id result))successBlock
         failture:(void (^)(NSError *error))failtureBlock{
    NSString * urlStr = DEF_URL_LOGIN;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = OKDicBind(iphone,password,randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)register_iphone:(NSString *)iphone
              password:(NSString *)password
           source_code:(NSString *)source_code
                  code:(NSString *)code
               Success:(void (^)(id result))successBlock
              failture:(void (^)(NSError *error))failtureBlock{
    NSString * urlStr = DEF_URL_REGISTER;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = OKDicBind(iphone,password,source_code,code,randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)setPassword_iphone:(NSString *)iphone password:(NSString *)password code:(NSString *)code Success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
    NSString * urlStr = DEF_URL_FORGET;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = OKDicBind(iphone,password,code,randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)homeList_Success:(void (^)(id result))successBlock
                failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_HOME;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    //NSString * uid = DEF_UID;
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign);
        [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)schoolDetail_sid:(NSString *)sid
                Success:(void (^)(id result))successBlock
               failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_SCHOOLDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"id":sid,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)teacherList_school_id:(NSString *)school_id success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
    NSString *urlStr = DEF_URL_TEACHERLIST;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign,school_id);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)checkSchool_success:(void (^)(id result))successBlock
                  failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_CHECKSCHOOL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)studentEntry_schoolId:(NSString *)schoolId
                     success:(void (^)(id result))successBlock
                   failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_STUDENTENTRY;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid,schoolId);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)studyCar_parm:(NSDictionary *)parm
            _success:(void (^)(id result))successBlock
            failture:(void (^)(NSError *error))failtureBlock{//DEF_URL_CHECKCAR
    NSString *urlStr = DEF_URL_STUDYCAR;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:parm];
    [dict setObject:randNumber forKey:@"randNumber"];
    [dict setObject:timeStamp forKey:@"timeStamp"];
    [dict setObject:secretString forKey:@"secretString"];
    [dict setObject:sign forKey:@"sign"];
    [dict setObject:DEF_UID forKey:@"uid"];
    
    [RequestHttpNetWrok requestPostWithParameters:dict urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)studyCarWxpay_parm:(NSDictionary *)parm
            _success:(void (^)(id result))successBlock
            failture:(void (^)(NSError *error))failtureBlock{//DEF_URL_CHECKCAR
    NSString *urlStr = DEF_URL_STUDYCARWX;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:parm];
    [dict setObject:randNumber forKey:@"randNumber"];
    [dict setObject:timeStamp forKey:@"timeStamp"];
    [dict setObject:secretString forKey:@"secretString"];
    [dict setObject:sign forKey:@"sign"];
    [dict setObject:DEF_UID forKey:@"uid"];
    
    [RequestHttpNetWrok requestPostWithParameters:dict urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}


+ (void)serviceList_Success:(void (^)(id result))successBlock
                   failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_SERVICE;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}
+(void)carBanner_success:(void (^)(id result))successBlock
                failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_CARINBANNER;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)insuranceSubscribe_parm:(NSDictionary *)parm
                        success:(void (^)(id result))successBlock
                       failture:(void (^)(NSError *error))failtureBlock{//DEF_URL_CHECKCAR
    NSString *urlStr = DEF_URL_CARINSURANCE;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:parm];
    [dict setObject:randNumber forKey:@"randNumber"];
    [dict setObject:timeStamp forKey:@"timeStamp"];
    [dict setObject:secretString forKey:@"secretString"];
    [dict setObject:sign forKey:@"sign"];
    [dict setObject:DEF_UID forKey:@"uid"];
    
    [RequestHttpNetWrok requestPostWithParameters:dict urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)personalIndex_success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALINDEX;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}
+(void)PersonalLink_success:(void (^)(id result))successBlock
                   failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALLINK;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)personalIndexdetail_success:(void (^)(id result))successBlock
                          failture:(void (^)(NSError *error))failtureBlock{
    {
        NSString *urlStr = DEF_URL_PERSONALDETAIL;
        int num = (arc4random() % 10000);
        NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
        NSString * timeStamp = [DateUtil getNowDateWithTime];
        NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
        NSString * sign = [[CFUtility sha1:secretString] md5];
        NSString * uid = DEF_UID;
        NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid);
        [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
            successBlock(result);
        } failHandle:^(NSError *error) {
            failtureBlock(error);
        }];
    }
    
}

+ (void)personalMessage_page:(NSString *)page success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
        NSString *urlStr = DEF_URL_PERSONALMESSAGE;
        int num = (arc4random() % 10000);
        NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
        NSString * timeStamp = [DateUtil getNowDateWithTime];
        NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
        NSString * sign = [[CFUtility sha1:secretString] md5];
        NSString * uid = DEF_UID;
        NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid,page);
        [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
            successBlock(result);
        } failHandle:^(NSError *error) {
            failtureBlock(error);
        }];
}

+(void)personalIntegralExchange_page:(NSString *)page success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALEXCHANGE;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid,page);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)personalOrder_success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALORDER;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)perdonlCustomer_success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALCUSTOMER;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)personalAccident_success:(void (^)(id))successBlock failture:(void (^)(NSError *))failtureBlock{
    NSString *urlStr = DEF_URL_OERSONALACCIDENT;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)personalRequirement_success:(void (^)(id result))successBlock
                          failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONLREQIRMENAT;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)personalInspectTime_success:(void (^)(id result))successBlock
failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALINSPECTTIME;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)dateIsReserve_id:(NSString *)timeId
                 success:(void (^)(id result))successBlock
                failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_DATEISRESERVE;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = @{@"id":timeId,
                             @"randNumber":randNumber,
                             @"timeStamp":timeStamp,
                             @"sign":sign
                             };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)personalUploadImg_image:(NSString *)image
                     imageData:(NSData *)imageData
                       success:(void (^)(id result))successBlock
                      failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALUPLOAD;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,image);
    [RequestHttpNetWrok upDataImageWithParameters:parm urlString:urlStr fileNameArr:@[image] dataPathArr:@[imageData] finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
          failtureBlock(error);
    }];
 
}
+(void)checkPeople_success:(void (^)(id result))successBlock
                 failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALCHECK;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}
+ (void)checkTeam_success:(void (^)(id result))successBlock
                 failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_TEAMCHECK;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)checkCar_parm:(NSDictionary *)parm
             success:(void (^)(id result))successBlock
            failture:(void (^)(NSError *error))failtureBlock{//DEF_URL_CHECKCAR
    NSString *urlStr = DEF_URL_CHECKCAR;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:parm];
    [dict setObject:randNumber forKey:@"randNumber"];
    [dict setObject:timeStamp forKey:@"timeStamp"];
    [dict setObject:sign forKey:@"sign"];
    
    [RequestHttpNetWrok requestPostWithParameters:dict urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}
+(void)checkCarWXPay_parm:(NSDictionary *)parm
                  success:(void (^)(id result))successBlock
                 failture:(void (^)(NSError *error))failtureBlock{//DEF_URL_CHECKCAR
    NSString *urlStr = DEF_URL_WXPAYCHECKCAR;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithDictionary:parm];
    [dict setObject:randNumber forKey:@"randNumber"];
    [dict setObject:timeStamp forKey:@"timeStamp"];
    [dict setObject:sign forKey:@"sign"];
    
    [RequestHttpNetWrok requestPostWithParameters:dict urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+(void)personalTeam_number:(NSString *)number
                  contacts:(NSString *)contacts
            contacts_phone:(NSString *)contacts_phone
                   company:(NSString *)company
                   success:(void (^)(id result))successBlock
                  failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_PERSONALTEAM;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * member_id = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,number,contacts,contacts_phone,company,member_id);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)serviceDetail_id:(NSString *)serId
                 success:(void (^)(id result))successBlock
                failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_SERVICEDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"id":serId,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)serviceGoodsDetail_id:(NSString *)goodsId
                 success:(void (^)(id result))successBlock
                failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_SERVICEGOODSDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"id":goodsId,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)serviceExchange_product:(NSString *)product
                     product_id:(NSString *)product_id
                       integral:(NSString *)integral
                    is_exchange:(NSString *)is_exchange
                      seller_id:(NSString *)seller_id
                        success:(void (^)(id result))successBlock
                       failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_SERVICEEXCHANGE;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid,product,product_id,integral,is_exchange,seller_id);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)serviceProductbuy_product:(NSString *)product
                       product_id:(NSString *)product_id
                         integral:(NSString *)integral
                            money:(NSString *)money
                        seller_id:(NSString *)seller_id
                      is_exchange:(NSString *)is_exchange
                              pay:(NSString *)payWay
                          success:(void (^)(id result))successBlock
                         failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = @"";
    if ([payWay isEqualToString:@"0"]) {
        urlStr = DEF_URL_SERVICEBUY;
    }else{
        urlStr = DEF_URL_SERVICEBUYWX;
    }
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSString * source = @"IOS";
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,uid,product,product_id,integral,is_exchange,money,seller_id,source);
    
    
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}


+ (void)paycarBanner_success:(void (^)(id result))successBlock
                    failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_CARBANNER;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)paycarGroup_success:(void (^)(id result))successBlock
              failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_PAYCARGROUP;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)payCarList_type_id:(NSString *)type_id
                  money_id:(NSString *)money_id
                success:(void (^)(id result))successBlock
               failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_CARLIST;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,type_id,money_id);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)payUserdCarList_type_id:(NSString *)type_id
                  money_id:(NSString *)money_id
                          order:(NSString *)order
                   success:(void (^)(id result))successBlock
                  failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_USERDCARLIST;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign,type_id,money_id,order);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)carDetail_id:(NSString *)carId
             success:(void (^)(id result))successBlock
            failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_CARDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"id":carId,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)groupDetail_id:(NSString *)carId
             success:(void (^)(id result))successBlock
            failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_GROUPDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"id":carId,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)useredCarDetail_id:(NSString *)carId
             success:(void (^)(id result))successBlock
            failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_OLDCARDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"id":carId,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)seeCar_name:(NSString *)name
             iphone:(NSString *)iphone
         vehicle_id:(NSString *)vehicle_id
                seller_id:(NSString *)seller_id
                  success:(void (^)(id result))successBlock
                 failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_SEECAR;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"name":name,
                            @"iphone":iphone,
                            @"uid":DEF_UID,
                            @"vehicle_id":vehicle_id,
                            @"seller_id":seller_id,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)groupBuy_name:(NSString *)name
          is_purchase:(NSString *)is_purchase
               iphone:(NSString *)iphone
              success:(void (^)(id result))successBlock
             failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_CARDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm =  OKDicBind(randNumber,timeStamp,sign,uid,name,is_purchase,iphone);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)giftList_success:(void (^)(id result))successBlock
                failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_GIFT;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm  = OKDicBind(randNumber,timeStamp,sign);
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)giftDetail_pid:(NSString *)pid
               success:(void (^)(id result))successBlock
              failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_GIFTDETAIL;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = @{@"id":pid,
                            @"randNumber":randNumber,
                            @"timeStamp":timeStamp,
                            @"sign":sign
                            };
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)giftbuyAlipays_price:(NSString *)price
                     gift_id:(NSString *)gift_id
                     success:(void (^)(id result))successBlock
                    failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_GIFTALIPAYS;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSString * phone = DEF_PHONE;
    NSString * source = @"IOS";
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign,price,gift_id,uid,phone,source);
    
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)giftWechatpay_price:(NSString *)price
                    gift_id:(NSString *)gift_id
                    success:(void (^)(id result))successBlock
                   failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_GIFTWXPAY;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSString * phone = DEF_PHONE;
     NSString * source = @"IOS";
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign,price,gift_id,uid,phone,source);
    
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)myGift_success:(void (^)(id result))successBlock
              failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_MYGIFTORDER;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign,uid);
    
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)changePassword_iphone:(NSString *)iphone
                     password:(NSString *)password
                         code:(NSString *)code
                      success:(void (^)(id result))successBlock
                     failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_CHANGEPASSWOED;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign,iphone,password,code);
    
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

+ (void)personalInvite_success:(void (^)(id result))successBlock
                      failture:(void (^)(NSError *error))failtureBlock{
    NSString *urlStr = DEF_URL_INVITE;
    int num = (arc4random() % 10000);
    NSString * randNumber = [NSString stringWithFormat:@"%.4d", num];
    NSString * timeStamp = [DateUtil getNowDateWithTime];
    NSString * secretString = [[NSString stringWithFormat:@"secretString=%@&randNumber=%@&timeStamp=%@",SECRETKEY,randNumber,timeStamp] uppercaseString];
    NSString * sign = [[CFUtility sha1:secretString] md5];
    NSString * uid = DEF_UID;
    NSDictionary * parm = OKDicBind(randNumber,timeStamp,sign,uid);
    
    [RequestHttpNetWrok requestPostWithParameters:parm urlString:urlStr finishHandle:^(id result) {
        successBlock(result);
    } failHandle:^(NSError *error) {
        failtureBlock(error);
    }];
}

@end
